package com.nulldev.util.net.packets.generic;

import com.nulldev.util.net.packets.APILevel;
import com.nulldev.util.net.packets.NetInfo;
import com.nulldev.util.net.packets.UniversalPacket;

@APILevel(level = 1)
public class RemovedByServer extends UniversalPacket {

	public RemovedByServer() {
		super("Kicked from Server", "user.kick", "reason.generic");
	}

	@Override
	public void client(byte[] data, byte[] raw, NetInfo client) {
		// Keep this, the server won't talk with you anyways.
		client.disconnect();
		final String reason = createString(data);
		client.onRemoved(reason);
	}

	@Override
	public void server(byte[] data, byte[] raw, NetInfo connection) {
	}

}
